// index.ts
// 获取应用实例
Page({
  data: {
    lunbotu:[
      {
        id:0,
        imgurl:"/images/4.png"
      },
      {
        id:1,
        imgurl:"/images/3.jpg"
      },
      {
        id:2,
        imgurl:"/images/2.jpg"
      },
      {
        id:4,
        imgurl:"/images/1.jpg"
      },
    ],
    contentlist:[],
},

  onShow(){
    wx.request({
      url: 'http://localhost:9000/video',
      method: "GET",
      success:(res)=>{
        this.setData({
          contentlist: res.data
        })
      }
    })
  },

  tiao:function(){
    wx.navigateTo({
      url:'../sort/sort',
    })
  },
  tiao2:function(){
    wx.navigateTo({
      url:'../top/top',
    })
  },
  display:function(e){
    var data=[this.data.contentlist[e.currentTarget.id-1]]
    wx.navigateTo({
      url:`../display/display?data=${JSON.stringify(data)}`,
    })
  },
  sousuo:function(){
    wx.navigateTo({
      url:'../sousuo/sousuo',
    })
  }
})
